<template>
  <div class="detail-page">
    <div class="page-header">
      <div class="title-box">
        <el-button class="back-button" icon="el-icon-back" @click="goback">返回</el-button>
        <div class="page-title">详情</div>
      </div>
    </div>
    <div class="page-body">
      <div class="titleStyle">
        <span>帮扶工作概况</span>
      </div>
      <el-descriptions :column="1">
        <el-descriptions-item label="帮扶工作标题">{{ form.titleHelpWork }}</el-descriptions-item>
        <el-descriptions-item label="帮扶工作地点">{{ form.helpingWorkPlace }}</el-descriptions-item>
        <el-descriptions-item label="帮扶工作内容">{{ form.helpingWorkContent }}</el-descriptions-item>
        <el-descriptions-item label="帮扶工作发起人">{{ form.sponsorName }}</el-descriptions-item>
        <el-descriptions-item label="帮扶工作发起时间">{{ form.initiationTime }}</el-descriptions-item>
        <el-descriptions-item label="指派交办人">{{ form.assignDelegateName }}</el-descriptions-item>
      </el-descriptions>
      <div class="titleStyle">
        <span>帮扶工作笔记</span>
      </div>
      <el-form label-width="140px">
        <el-form-item label="帮扶工作办结人">
          <el-input v-model="form.completeHelpingWorkName" size="mini" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="帮扶工作办结时间">
          <el-date-picker
            v-model="form.completeHelpingWorkTime"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
            size="mini"
          />
        </el-form-item>
        <el-form-item label="笔记内容">
          <el-input v-model="form.noteContent" type="textarea" :rows="3" size="mini" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="工作照片">
          <el-upload
            v-model="form.photoWork"
            action="#"
            list-type="picture-card"
          >
            <i class="el-icon-plus"></i>
          </el-upload>
        </el-form-item>
      </el-form>
    </div>
    <div class="page-footer">
      <el-button type="primary" size="mini" @click="sumbit">保存</el-button>
    </div>
  </div>
</template>
<script>
import { edit } from '@/api/cadreBusiness/massAssistance'
export default {
  data () {
    return {
      form: {},
      tableData: []
    }
  },
  methods: {
    init (row) {
      this.form = { ...row }
    },
    goback () {
      this.$emit('goback')
    },
    sumbit () {
      edit(this.form).then((res) => {
        this.$message.success('保存成功')
        this.$emit('goback', true)
      })
    },
    detailToEdit () {
      this.$emit('detailToEdit', this.form)
    }
  }
}
</script>
<style scoped lang="scss">
  .page-header {
    display: flex;
    height: 60px;
    align-items: center;
    border-bottom: 1px solid #ddd;
    // justify-content: space-between;
    .title-box {
      display: flex;
      height: 60px;
      align-items: center;
    }
    .back-button {
      margin-right: 16px;
    }
    .page-title {
      font-size: 18px;
      font-weight: 600;
    }
  }
  .page-body {
    height: calc(100vh - 190px);
    overflow-y: auto;
    position: relative;
    .titleStyle {
      font-weight: 600;
      height: 35px;
      line-height: 35px;
      padding-left: 10px;
      padding-right: 10px;
      margin-bottom: 8px;
      background-color: #d8eff9;
      display: flex;
      justify-content: space-between;
    }
  }
  .page-footer {
    height: 60px;
    text-align: center;
    line-height: 60px;
  }
</style>
